package org.eiahe.hr.attendance.domain.vo;

import cn.idev.excel.annotation.ExcelIgnore;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.converters.Converter;
import org.apache.poi.ss.usermodel.Cell;
import cn.idev.excel.write.handler.WriteHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.eiahe.hr.attendance.converter.LocalTimeConverter;
import org.eiahe.hr.attendance.domain.OvertimeRecord;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

/**
 * 加班记录视图对象 hr_overtime_record
 *
 * @author zhangnn
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = OvertimeRecord.class)
public class OvertimeRecordVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 记录ID
     */
    @ExcelProperty(value = "记录ID")
    private Long recordId;

    /**
     * 工号
     */
    @ExcelProperty(value = "工号")
    private String employeeNo;

    /**
     * 员工姓名
     */
    @ExcelProperty(value = "员工姓名")
    private String employeeName;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 加班日期
     */
    @ExcelProperty(value = "加班日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate overtimeDate;

    /**
     * 开始时间
     */
    @ExcelProperty(value = "开始时间", converter = org.eiahe.hr.attendance.converter.LocalTimeConverter.class // 指定自定义转换器
    )
    @JsonFormat(pattern = "HH:mm")
    private LocalTime startTime;

    /**
     * 结束时间
     */
    @ExcelProperty(value = "结束时间", converter = org.eiahe.hr.attendance.converter.LocalTimeConverter.class)
    @JsonFormat(pattern = "HH:mm")
    private LocalTime endTime;

    /**
     * 加班时长(分钟)
     */
    @ExcelProperty(value = "加班时长(分钟)")
    private Integer overtimeMinutes;

    /**
     * 加班时长(小时)
     */
    @ExcelProperty(value = "加班时长(小时)")
    private Double overtimeHours;

    /**
     * 加班类型
     */
    private String overtimeType;

    /**
     * 加班类型名称
     */
    @ExcelProperty(value = "加班类型名称")
    private String overtimeTypeName;

    /**
     * 来源
     */
    private String source;

    /**
     * 来源名称
     */
    @ExcelProperty(value = "来源名称")
    private String sourceName;

    /**
     * 加班事由
     */
    @ExcelProperty(value = "加班事由")
    private String reason;

    /**
     * 审批状态
     */
    @ExcelProperty(value = "审批状态")
    private String approvalStatus;

    /**
     * 审批状态名称
     */
    @ExcelProperty(value = "审批状态名称")
    private String approvalStatusName;

    /**
     * 状态
     */
    @ExcelProperty(value = "状态")
    private String status;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remark;

    private String delFlag;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
}
